package com.maxlen.goods.entity.vo;

import com.maxlen.common.valid.AddValid;
import com.maxlen.common.valid.UpdateValid;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

@Data
public class AttrGroupVO {

    /**
     * 分组id
     */
    @Null(message = "新增操作id必须为空", groups = AddValid.class)
    @NotNull(message = "修改操作id不能为空", groups = UpdateValid.class)
    private Long attrGroupId;

    /**
     * 组名
     */
    @NotBlank(message = "组名不能为空", groups = AddValid.class)
    @Length(min = 1,message = "组名不能为空", groups = UpdateValid.class)
    @Length(max = 10, message = "组名不能超过10个字符", groups = {AddValid.class, UpdateValid.class})
    private String attrGroupName;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = AddValid.class)
    @Min(value = 0, message = "排序必须是一个大于0的整数", groups = {AddValid.class, UpdateValid.class})
    private Integer sort;

    /**
     * 描述
     */
    @Length(max = 20, message = "描述不能超过20个字符", groups = {AddValid.class, UpdateValid.class})
    private String descript;

    /**
     * 组图标
     */
    @NotBlank(message = "组图标不能为空", groups = AddValid.class)
    @Length(min = 1,message = "组图标不能为空", groups = UpdateValid.class)
    private String icon;

    /**
     * 所属分类id
     */
    @NotNull(message = "所属分类id不能为空", groups = AddValid.class)
    private Long catelogId;

}
